﻿/**
 * Stone.cs - Stones which fall and can kill the player
 * 
 * Part of BoulderDAM - A BoulderDash clone using C# and SDL
 * Nacho Cabanes & students of DAM IES San Vicente, 2014
 * 
 * Revisions
 * #     Date         Creator, changes
 * ----  -----------  -------------------------------------------------------
 * 0.01  02-apr-2014  Nacho Cabanes: Only constructor
 * 0.02  03-apr-2014  Adil Casamayor Silvar
 *   The stone falls down to certain possition
 * 
 */

namespace Boulder
{
    class Stone : Sprite
    {
        /*
         * 
        protected int x, y;
        protected int startX, startY;
        protected int width, height;
        protected int xSpeed, ySpeed;
        protected bool visible;
        protected Image image;
        protected Image[][] sequence;
        protected bool containsSequence;
        protected int currentFrame;
         * 
         */

        protected bool isCollisioning;
        protected bool isFalling;

        public Stone()
        {
            LoadImage("data/stone.png");

            MoveTo(100, 20);

            xSpeed = 0;
            ySpeed = 10;
            isCollisioning = false;
            isFalling = false;
        }

        public override void Animate()
        {
            if (!isCollisioning)
            {
                y += ySpeed;
                isFalling = true;
            }

            if (y >= 400)
            {
                isCollisioning = true;
                isFalling = false;
            }
        }
    }
}